import handleArr from "./index";
// 管理数据

let reducer = (
  state = { ...handleArr.state }, // 解构
  action: { type: string; value: number }
) => {
  // 深度复制
  let newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case handleArr.sarrpush:
      handleArr.actions[handleArr.sarrpush](newState, action);
      break;
    default:
      break;
  }

  return newState;
};

export default reducer;
